package com.stormrage.edu.serv.student.impl;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.stormrage.edu.dao.student.StuAcctDao;
import com.stormrage.edu.serv.adm.impl.AdmAcctServImpl;
import com.stormrage.edu.serv.student.StuAcctServ;
import com.stormrage.entity.student.StuAcct;
import com.stormragetech.core.exception.StormrageTechException;

public class StuAcctServImpl implements StuAcctServ {

	private static final Logger logger = LoggerFactory.getLogger(AdmAcctServImpl.class);

	@Autowired
	private StuAcctDao stuAcctDao;

	@Override
	public Integer create(StuAcct arg0) throws StormrageTechException {
		logger.debug(" 【 Serv 】- 【 StuAcctServ 】- 【 Create 】- 开始运行 ");

		Integer index = stuAcctDao.create(arg0);

		logger.debug(" 【 Serv 】- 【 StuAcctServ 】- 【 Create 】- 完成运行 ");
		return index;
	}

	@Override
	public void update(StuAcct arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 StuAcctServ 】- 【 Update 】- 开始运行 ");

		stuAcctDao.update(arg0);

		logger.debug(" 【 Serv 】- 【 StuAcctServ 】- 【 Update 】- 完成运行 ");

	}

	@Override
	public StuAcct queryById(Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 StuAcctServ 】- 【 QueryById 】- 开始运行 ");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		StuAcct entity = stuAcctDao.queryById(map);

		logger.debug(" 【 Serv 】- 【 StuAcctServ 】- 【 QueryById 】- 完成运行 ");
		return entity;

	}

}
